package org.spring.beans.factory.annotation;

import java.util.LinkedList;
import java.util.List;

public class InjectionMetadata {
	private Class<?> targetClass;
	private List<InjectionElement> injectionElements;

	public InjectionMetadata(Class<?> clz, LinkedList<InjectionElement> elements) {
		this.targetClass = clz;
		this.injectionElements = elements;
	}

	public List<InjectionElement> getInjectionElements() {
		return this.injectionElements;
	}
	
	public void inject(Object target) {
		if(injectionElements == null || injectionElements.isEmpty()) {
			return;
		}
		for (InjectionElement element:injectionElements) {
			element.inject(target);
		}
	}
}
